//package homework;

//import static org.junit.Assert.*;
//import java.util.Arrays;
//import org.junit.*;
//
//import homework.BubbleSort;
//
//public class TestBubbleSort {
//
//	@Test
//	public void testBubbleSort() {
//		int x[][]={
//				{5,4,3,2,1},
//				{1,6,2,2,5},
//				{55,-5,15,0,1,20,10,5}};
//		int y[][]={{1,2,3,4,5},{1,2,2,5,6},{-5,0,1,5,10,15,20,55}};
//			assertArrayEquals(y[0],BubbleSort.BubbleSort(x[0]));
//			assertArrayEquals(y[1],BubbleSort.BubbleSort(x[1]));
//			assertArrayEquals(y[2],BubbleSort.BubbleSort(x[2]));
//	}
//
//}
import static org.junit.Assert.*;

import java.util.Arrays;
import java.util.Collection;

import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

//import homework.BubbleSort;

@RunWith(Parameterized.class)
public class TestBubbleSort {
	private int[] x;
	private int[] y;
	private BubbleSort test = null;
	
	public TestBubbleSort(int[] x, int[] y){
		this.x = x;
		this.y = y;
	}
	
	@Parameters
	public static Collection getData(){
		int list1[]={5,4,3,2,1};           int list2[]={1,2,3,4,5};
		int list3[]={1,6,2,2,5};           int list4[]={1,2,2,5,6};
		int list5[]={55,-5,15,0,1,20,10,5};int list6[]={-5,0,1,5,10,15,20,55};
		return Arrays.asList(new Object[][]{
						  {list1,list2},
						  {list3,list4},
						  {list5,list6}});
		
	}
	
	@Before
	public void setUp(){
		test = new BubbleSort();
	}

	@Test
	public void testBubbleSort() {
		
		assertArrayEquals(this.y,test.BubbleSort(x));	
	}
	
	@AfterClass
	public static void testResult(){
		
	//	System.out.println();
	}
	

}
